package com.best.member;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import com.best.core.utils.IdWorker;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.spring4all.swagger.EnableSwagger2Doc;

/**
 * @ClassName: AppMember
 * @Package: com.best.member
 * @Description: 会员服务
 * @Datetime: 2020/6/5 16:28
 * @Author: nike
 */

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableEurekaClient
@EnableFeignClients
@EnableSwagger2Doc
@EnableApolloConfig
@MapperScan("com.best.member.mapper") // 扫描mapper所在的包
@ComponentScan("com.best") // 扫描一些组件类所在的包
public class AppMember {
    
    /**
     * @description: 启动入口，启动时加上配置：-Dapollo.configService=http://120.24.71.90:8080
     * @Param: [args]
     * @return: void
     * @author: 李东
     * @time: 2020-7-6 17:22
     **/
    public static void main(String[] args) {
        SpringApplication.run(AppMember.class, args);
    }

    /**
     * id生成器
     * 
     * @return
     */
    @Bean
    public IdWorker idWorker() {
        return new IdWorker(1, 1);
    }
}
